package com.cainiao.control;

import com.cainiao.bean.Employees;
import com.cainiao.service.EmployeesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
import java.util.Map;

/**
 * @author shkstart
 * @create 2021-04-15 9:32
 */
@Controller //控制器
public class EmployeesControl {

    @Autowired
    EmployeesService employeesService;

    @RequestMapping("/getemps")
    public String emps(Map<String, Object> map) {
        List<Employees> list = employeesService.getEmpList();
        map.put("allEmps", list);//把所有员工放到请求于域中
        return "list";
    }
}
